'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.wrapGet = exports.getWithKey = exports.get = undefined;

var _get3 = require('lodash/get');

var _get4 = _interopRequireDefault(_get3);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _get2 = function _get2(state, path, defVal) {
    if (!path) {
        return state;
    }
    return (0, _get4.default)(state, path, defVal);
};
exports.get = _get2;
var _getWithKey = function _getWithKey(state, key, path, defVal) {
    var _state = (0, _get4.default)(state, key);
    return _get2(_state, path, defVal);
};
exports.getWithKey = _getWithKey;
var wrapGet = exports.wrapGet = function wrapGet(data) {
    return {
        get: function get(path, defVal) {
            return _get2(data, path, defVal);
        },
        getWithKey: function getWithKey(key, path, defVal) {
            return _getWithKey(data, key, path, defVal);
        }
    };
};
exports.default = _get2;